package org.anupta.realm.server.inter.packet.account;

import org.anupta.realm.entity.entities.Account;
import org.anupta.realm.main.Main;
import org.anupta.realm.server.inter.client.InterClient;
import org.anupta.realm.server.inter.packet.InterPacket;
import org.anupta.realm.server.inter.packet.InterPacketID;
import org.apache.mina.core.buffer.IoBuffer;

public class AccountWaiting extends InterPacket {
	private Account acc = null;

	public AccountWaiting(InterClient client,Account account) {
		super(client);
		acc = account;
		pack(packetOut);
		doPacket(packetOut);
	}

	@Override
	public void unpack(IoBuffer buffer) {
	}

	@Override
	public void pack(IoBuffer buffer) {
		buffer.put(InterPacketID.ACCOUNT_WAITING.getId());
		buffer.putInt(acc.getGuid());
	}

	@Override
	public void doPacket(IoBuffer buffer) {
		client.send(this);
		Main.out.println(new StringBuilder("AccountWaiting packet sended to game : ").append(client.getGuid()).toString());
	}
}
